package com.iptv.grape.bu.imp;

import android.view.KeyEvent;

import com.iptv.grape.BaseActivity;
import com.iptv.grape.bu.AppState;
import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.bu.IKeyEventPorc;
import com.iptv.grape.util.AppLog;
import com.iptv.grape.video.XMediaPlayer;

// 暂停播放
@AppState(isShowLiveMenu = false,isShowChannelBillUI = false,curPlayType="Vod",keyVals = {23,66})
public class VodPausePlay implements IKeyEventPorc {
    @Override
    public void onKeyDownEvent(BaseActivity context, XMediaPlayer mediaPlayer, GrapeContext grapeContext, KeyEvent event) {
        if(mediaPlayer.isPlaying()) {
            mediaPlayer.pause();
        }
        else {
            mediaPlayer.start();
        }
        //AppLog.getCurLog().out(mediaPlayer.isPlaying() + "");
    }
}
